package com.cloudkinto.service.home.vo;

import com.cloudkinto.common.utils.MathUtils;
import com.cloudkinto.dto.home.HomeCostDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
public class HomeCostRes {
    @ApiModelProperty("总费用")
    private double total;
    @ApiModelProperty("同比百分比")
    private String tongRate;
    @ApiModelProperty("同比 0 无变化 1 下降 2上升")
    private int tongType;
    @ApiModelProperty("环比百分比")
    private String huanRate;
    @ApiModelProperty("环比 0 无变化 1 下降 2上升")
    private int huanType;

    private List<HomeCostDto> list;


    public double getTotal() {
        return MathUtils.numberFormat(total, 2);
    }
}
